package com.yang.action;

import com.yang.service.ProductService;
import com.yang.service.ProductcarService;
import com.yang.util.RespEntity;
import com.yang.util.RespUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/productCarShopping")
public class ProductCarGgShoppingAction extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //得到购买的商品
        String[] pids = req.getParameterValues("pid");
        //发送的地址
        String add=req.getParameter("addr");
        ProductcarService productcarService=new ProductcarService();
        RespEntity respEntity = productcarService.shopping(pids, add);
        RespUtil.sendJSON(resp,respEntity);
    }
}
